from app import db

class BodyMetrics(db.Model):
    __tablename__ = 'body_metrics'

    user_id = db.Column(db.String(255), db.ForeignKey('user_info.user_id'), primary_key=True)
    height = db.Column(db.Float)
    weight = db.Column(db.Float)
    BMI = db.Column(db.Float)
    BMR = db.Column(db.Integer)
    biceps = db.Column(db.Float)
    chest = db.Column(db.Float)
    waist = db.Column(db.Float)
    hip = db.Column(db.Float)
    waist_hip_ratio = db.Column(db.Float)
    thigh = db.Column(db.Float)
    body_fat = db.Column(db.Float)
    heart_rate_rest = db.Column(db.Integer)
    frequency_per_week = db.Column(db.Integer)
    dream_weight = db.Column(db.Integer)

    user = db.relationship('UserInfo', backref='body_metrics', uselist=False)

    def __repr__(self):
        return f'<BodyMetrics {self.user_id}>'
